:root {
  font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 亮色主题 */
:root.light {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --text-primary: #213547;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border-color: #e1e5e9;
  --shadow: rgba(0, 0, 0, 0.1);
  --shadow-hover: rgba(0, 0, 0, 0.15);
  --accent: #646cff;
  --accent-hover: #535bf2;
}

/* 暗色主题 */
:root.dark {
  --bg-primary: #1a1a1a;
  --bg-secondary: #242424;
  --text-primary: rgba(255, 255, 255, 0.87);
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-muted: rgba(255, 255, 255, 0.4);
  --border-color: #333333;
  --shadow: rgba(0, 0, 0, 0.3);
  --shadow-hover: rgba(0, 0, 0, 0.4);
  --accent: #646cff;
  --accent-hover: #535bf2;
}

/* 应用主题变量 */
:root {
  color: var(--text-primary);
  background-color: var(--bg-primary);
}

/* 防止白色背景闪现 */
html {
  background-color: var(--bg-primary);
  transition: background-color 0.3s ease;
}

/* 确保在主题切换过程中没有白色闪现 */
body {
  background-color: var(--bg-primary);
  transition: background-color 0.3s ease;
}

/* 为不支持 View Transition 的浏览器提供平滑过渡 */
@media (prefers-reduced-motion: no-preference) {
  * {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  }
}

a {
  font-weight: 500;
  color: var(--accent);
  text-decoration: inherit;
}

a:hover {
  color: var(--accent-hover);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

h1 {
  font-size: 3.2em;
  line-height: 1.1;
}

button {
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.6em 1.2em;
  font-size: 1em;
  font-weight: 500;
  font-family: inherit;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.25s ease;
}

button:hover {
  border-color: var(--accent);
  background-color: var(--bg-primary);
}

button:focus,
button:focus-visible {
  outline: 4px auto -webkit-focus-ring-color;
}

/* 主题切换按钮样式 */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px var(--shadow);
  transition: all 0.3s ease;
}


/* 无限滚动列表样式 */
.infinite-scroll-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.list-title {
  text-align: center;
  margin-bottom: 30px;
  color: var(--text-primary);
  font-size: 2.5em;
}

.list-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 40px;
}

.list-item {
  background: var(--bg-primary);
  border-radius: 12px;
  box-shadow: 0 4px 6px var(--shadow);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  display: flex;
  align-items: stretch;
}

.list-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px var(--shadow-hover);
}

.item-cover {
  width: 300px;
  height: 200px;
  overflow: hidden;
  flex-shrink: 0;
}

.item-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.list-item:hover .item-cover img {
  transform: scale(1.05);
}

.item-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.item-title {
  font-size: 1.3em;
  font-weight: 600;
  margin: 0 0 10px 0;
  color: var(--text-primary);
  line-height: 1.4;
}

.item-overview {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
  font-size: 0.95em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.loading-indicator {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 0;
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.loading-spinner p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9em;
}

.no-more {
  text-align: center;
}

.no-more p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9em;
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: 8px;
  display: inline-block;
}


/* 响应式设计 */
@media (max-width: 768px) {
  .list-item {
    flex-direction: column;
  }

  .item-cover {
    width: 100%;
    height: 200px;
  }

  .item-content {
    padding: 15px;
  }

  .infinite-scroll-container {
    padding: 10px;
  }
}